package com.kuyou.ddhm_tv.DataBase;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class BloodSugarDatabase extends SQLiteOpenHelper {

    public static final String CREATE_BLOODSUGAR = "create table Bloodsugar("
            + "id integer primary key autoincrement,"
            + "paperType text,"
            + "bloodSugarLevels double,"
            + "statue text,"
            + "date text)";


    public static final String CREATE_BLOODPRESsURE = "create table Bloodpressure("
            + "id integer primary key autoincrement,"
            + "height int(10),"
            + "low int(10),"
            + "bp int(10),"
            + "date text)";

    public static final String CREATE_BLOODOxygen = "create table BloodOxygen("
            + "id integer primary key autoincrement,"
            + "BO int(10),"
            + "PR int(10),"
            + "date text)";
    public static final String CREATE_EGC = "create table EGC("
            + "id integer primary key autoincrement,"
            + "PR int(10),"
            + "other text,"
            + "EGCData text,"
            + "date text)";
    public static final String CREATE_DIVER = "create table Diver("
            + "id integer primary key autoincrement,"
            + "name text,"
            + "uuid text,"
            + "address text)";
    public static final String CREATE_REPORT = "create table Report("
            + "id integer primary key autoincrement,"
            + "date text,"
            + "context text,"
            + "data_id integer)";


    public static final String CREATE_ME = "create table ME("
            + "id integer primary key autoincrement,"
            + "time text,"
            + "report text,"
            + "high double,"
            + "low double,"
            + "bpm int(10),"
            + "bo int(10),"
            + "bp int(10),"
            + "pr int(10),"
            + "bs double,"
            + "dgc double,"
            + "ns double,"
            + "xt double,"
            + "egc text,"
            + "bsState text,"
            + "dgcState text,"
            + "nsState text,"
            + "xtState text)";

    private Context mContext;

    public BloodSugarDatabase(Context context, String name, SQLiteDatabase.CursorFactory factory, int version) {
        super(context, name, factory, version);
        mContext = context;

    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL(CREATE_BLOODSUGAR);
        db.execSQL(CREATE_BLOODPRESsURE);
        db.execSQL(CREATE_BLOODOxygen);
        db.execSQL(CREATE_EGC);
        db.execSQL(CREATE_DIVER);
        db.execSQL(CREATE_REPORT);
        db.execSQL(CREATE_ME);

    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }


}


